<?php 
class RegisterController extends Controller{
	/**
	 * 注册
	 */
	public function actionIndex(){
		if(!Yii::app()->user->isGuest)
			return $this->showError('你已经登录啦');
		$model = 'Member';
		$member = new $model('register');
		
		if(isset($_POST[$model])){
			$member->attributes = $_POST[$model];
			if($member->register()){
				return $this->showSuccess('恭喜注册成功哟<br>我们已经向您的邮箱发送了一封确认信', $this->createUrl('/member/login'));
			}
		}
		
		$this->render('index', array(
			'member' => $member
		));
	}
}
?>